package com.itheima.health.jobs;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.health.service.TimerDeleteService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author Guan
 * @version 1.0
 * @date 2020/11/22 14:45
 * @purpose :定时清理日期缓存
 */
@Controller
@Slf4j
public class TimerDeletejob {


    @Reference
    private TimerDeleteService timerDeleteService;

    /**
     * 定义清理
     */
    public void TimerDeleteDate() {
        //获取当前日期
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        String da = sdf.format(new Date());

        // String test = "2019-06-21";
        log.info("正在清理===========>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");

        timerDeleteService.timerDelete(da);
    }
}
